package com.xayy.health.mgt.model.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.xayy.health.mgt.model.Algorithm;
import com.xayy.health.mgt.model.TelemetryData;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;

/**
 * @author houchengwei
 */
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class TelemetryDto {
    @ApiModelProperty(value = "是否是批量上传 0是1不是")
    private Integer isBatch;

    @ApiModelProperty(value = "卫星名称")
    private String satelliteName;

    @Column(name = "satellite_id")
    private Long satelliteId;

    @Column(name = "algorithm_name")
    @ApiModelProperty(value = "算法名称")
    private String algorithmName;

    @ApiModelProperty(value = "参数名称")
    private String paramCodeName;

    @ApiModelProperty(value = "任务记录id")
    private Long taskRecordId;

    @JSONField(format = "yyyy/MM/dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @JSONField(format = "yyyy/MM/dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "卫星代号")
    private String satelliteCode;

    @ApiModelProperty(value = "参数", notes = "多选传这个")
    private String[] paramCodes;

    @ApiModelProperty(value = "参数", notes = "单选传这个")
    private String paramCode;

    @ApiModelProperty(value = "处理周期")
    private String cycle;

    private String tyTag;

    private String tcTag;

    private String phTag;

    @ApiModelProperty(value = "模型名称")
    private String modelName;


    @ApiModelProperty(value = "预测多少个点")
    private Integer predNumber;

    @ApiModelProperty(value = "预测间隔")
    private Integer timeSpan;


    @ApiModelProperty(value = "算法信息", hidden = true)
    private List<Algorithm> zjAlgorithmList;

    @ApiModelProperty(value = "遥测数据", hidden = true)
    private List<TelemetryData> telemetryDataList;

    @NotEmpty(message = "任务名称不能为空")
    @ApiModelProperty(value = "任务名称")
    @NotEmpty
    private String name;

    @ApiModelProperty(value = "数据采样间隔")
    private Integer timeInterval;

    @ApiModelProperty(value = "任务类型", notes = "1：数据处理2：事后诊断3：趋势预测")
    private Integer type;

    @ApiModelProperty(value = "是否是当前参数模型 1:是 0：不是")
    private Integer isCurrentParams;

    @ApiModelProperty(value = "多参数算法名称（存的是id）")
    private String multiparameterAlgName;

    /**
     * 均值需要的参数   pointNum，sampleTime，interval，probability
     */
    @ApiModelProperty(value = "连续取点个数")
    private String pointNum;

    @ApiModelProperty(value = "取值时间")
    private String sampleTime;

    @ApiModelProperty(value = "间隔点数")
    private String interval;

    @ApiModelProperty(value = "概率")
    private String probability;

    @ApiModelProperty(value = "偏差比")
    private String deviate;


    @ApiModelProperty(value = "图例名称")
    private String legendName;

    @ApiModelProperty(value = "图例id")
    private Long fileLogo;

    @ApiModelProperty(value = "是否调用模型 0否 1是")
    private Integer isCallModel;


    /**
     * 双参数（使用）
     */
    @ApiModelProperty(value = "正常开始时间")
    private Date normalStartTime;

    @ApiModelProperty(value = "正常结束时间")
    private Date normalEndTime;

    @ApiModelProperty(value = "是否多参数 1true是 0false否")
    private Boolean checkMultiparameter;

    @ApiModelProperty(value = "偏差比")
    private Double compare;

    /**
     * 案例一
     */
    @ApiModelProperty(value = "学习多段时间", required = true)
    private List<TimeDto> learnMultiTerminalTime;

    @ApiModelProperty(value = "检测时间", required = true)
    private TimeDto verifyTime;

    @ApiModelProperty(value = "门限值")
    private String threshold;

    @ApiModelProperty(value = "运行状态 1长期运行2阶段性运行")
    private Integer runningStatus;

    @ApiModelProperty(value = "长期运行结束时间")
    @Column(name = "long_running_time")
    private Date longRunningTime;

    @ApiModelProperty(value = "是否存在空值")
    private boolean hasNullValue;

    @ApiModelProperty(value = "数据来源：0：原始,1：处理后数据")
    private Integer originalDataSources;
}
